<!doctype html>


<html>
<head>
  <link rel="shortcut icon" href="static/images/favicon.ico" type="image/x-icon">
  <title>richstorage.js (Closure Library API Documentation - JavaScript)</title>
  <link rel="stylesheet" href="static/css/base.css">
  <link rel="stylesheet" href="static/css/doc.css">
  <link rel="stylesheet" href="static/css/sidetree.css">
  <link rel="stylesheet" href="static/css/prettify.css">

  <script>
     var _staticFilePath = "static/";
     var _typeTreeName = "goog";
     var _fileTreeName = "Source";
  </script>

  <script src="static/js/doc.js">
  </script>


  <meta charset="utf8">
</head>

<body onload="grokdoc.onLoad();">

<div id="header">
  <div class="g-section g-tpl-50-50 g-split">
    <div class="g-unit g-first">
      <a id="logo" href="index.html">Closure Library API Documentation</a>
    </div>

    <div class="g-unit">
      <div class="g-c">
        <strong>Go to class or file:</strong>
        <input type="text" id="ac">
      </div>
    </div>
  </div>
</div>





<div class="colmask rightmenu">
<div class="colleft">
    <div class="col1">
      <!-- Column 1 start -->

<div id="title">
       <span class="fn">richstorage.js</span>
</div>

<div class="g-section g-tpl-75-25">
  <div class="g-unit g-first" id="description">
    Provides a convenient API for data with attached metadata
 persistence. You probably don't want to use this class directly as it
 does not save any metadata by itself. It only provides the necessary
 infrastructure for subclasses that need to save metadata along with
 values stored.
  </div>
  

        <div class="g-unit" id="useful-links">
          <div class="title">Useful links</div>
          <ol>
            <li><a href="closure_goog_storage_richstorage.js.source.html"><span class='source-code-link'>Source Code</span></a></li>
            <li><a href="http://code.google.com/p/closure-library/source/browse/closure/goog/storage/richstorage.js">Git</a></li>
          </ol>
        </div>
</div>

<h2 class="g-first">File Location</h2>
  <div class="g-section g-tpl-20-80">
    <div class="g-unit g-first">
      <div class="g-c-cell code-label">storage/richstorage.js</div>
    </div>
  </div>
<hr/>


  <h2>Classes</h2>
 <div class="fn-constructor">
        <a href="class_goog_storage_RichStorage.html">
          goog.storage.RichStorage</a><br/>
        <div class="class-details">Provides a storage for data with attached metadata.</div>
 </div>
 <div class="fn-constructor">
        <a href="class_goog_storage_RichStorage_Wrapper.html">
          goog.storage.RichStorage.Wrapper</a><br/>
        <div class="class-details">Wraps a value so metadata can be associated with it. You probably want
to use goog.storage.RichStorage.Wrapper.wrapIfNecessary to avoid multiple
embeddings.</div>
 </div>
      
<br/>

  <div class="legend">
        <span class="key publickey"></span><span>Public</span>
        <span class="key protectedkey"></span><span>Protected</span>
        <span class="key privatekey"></span><span>Private</span>
  </div>









<div class="section">
  <table class="horiz-rule">


  </table>
</div>




  <h2>Global Functions</h2>





<div class="section">
  <table class="horiz-rule">


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.storage.RichStorage.call"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.storage.RichStorage.</span><span class="entryName">call<span class="args">()</span>
        </span>
      </div>


     <div class="entryOverview">
       <span class='nodesc'>No description.</span>
     </div>

   
  </td>


  <td class="view-code">
     <a href="closure_goog_storage_richstorage.js.source.html#line41">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.storage.RichStorage.Wrapper.unwrap"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.storage.RichStorage.Wrapper.</span><span class="entryName">unwrap<span class="args">(<span class="arg">wrapper</span>)</span>
        </span>
        &#8658; <div class="fullType"><span class="type">*</span></div>
      </div>


     <div class="entryOverview">
       Unwraps a value, any metadata is discarded (not returned). You might want to
use goog.storage.RichStorage.Wrapper.unwrapIfPossible to handle cases where
the wrapper is missing.
     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">wrapper</span>
        : <div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Object">Object</a></span></div>
        <div class="entryOverview">The wrapper.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<div class="fullType"><span class="type">*</span></div>&nbsp;
            The wrapped value.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="closure_goog_storage_richstorage.js.source.html#line93">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.storage.RichStorage.Wrapper.unwrapIfPossible"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.storage.RichStorage.Wrapper.</span><span class="entryName">unwrapIfPossible<span class="args">(<span class="arg">wrapper</span>)</span>
        </span>
        &#8658; <div class="fullType"><span class="type">*</span></div>
      </div>


     <div class="entryOverview">
       Convenience method for unwrapping a value. Returns undefined if the
wrapper is missing.
     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">wrapper</span>
        : <div class="fullType">(<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Object">Object</a></span><span>&nbsp;|&nbsp;</span><span class="type">undefined</span>)</div>
        <div class="entryOverview">The wrapper.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<div class="fullType"><span class="type">*</span></div>&nbsp;
            The wrapped value or undefined.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="closure_goog_storage_richstorage.js.source.html#line109">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.storage.RichStorage.Wrapper.wrapIfNecessary"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.storage.RichStorage.Wrapper.</span><span class="entryName">wrapIfNecessary<span class="args">(<span class="arg">value</span>)</span>
        </span>
        &#8658; <div class="fullType">(<span class="type"><a href="class_goog_storage_RichStorage_Wrapper.html">goog.storage.RichStorage.Wrapper</a></span><span>&nbsp;|&nbsp;</span><span class="type">undefined</span>)</div>
      </div>


     <div class="entryOverview">
       Convenience method for wrapping a value so metadata can be associated with
it. No-op if the value is already wrapped or is undefined.
     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">value</span>
        : <div class="fullType"><span class="type">*</span></div>
        <div class="entryOverview">The value to wrap.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<div class="fullType">(<span class="type"><a href="class_goog_storage_RichStorage_Wrapper.html">goog.storage.RichStorage.Wrapper</a></span><span>&nbsp;|&nbsp;</span><span class="type">undefined</span>)</div>&nbsp;
            The wrapper.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="closure_goog_storage_richstorage.js.source.html#line77">code &raquo;</a>
  </td>
     </tr>


  </table>
</div>



  <h2>Global Properties</h2>





<div class="section">
  <table class="horiz-rule">


     <tr class="even entry protected">
       <td class="access"></td>





  <a name="goog.storage.RichStorage.DATA_KEY"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.storage.RichStorage.</span><span class="entryName">DATA_KEY</span>
        : <div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span></div>
     </div>


     <div class="entryOverview">
       Metadata key under which the actual data is stored.
     </div>

  </td>


  <td class="view-code">
     <a href="closure_goog_storage_richstorage.js.source.html#line53">Code &raquo;</a>
  </td>
     </tr>


  </table>
</div>



      <!-- Column 1 end -->
    </div>

        <div class="col2">
          <!-- Column 2 start -->
          <div class="col2-c">
            <h2 id="ref-head">Directory storage</h2>
            <div id="localView"></div>
          </div>

          <div class="col2-c">
            <h2 id="ref-head">File Reference</h2>
            <div id="sideFileIndex" rootPath="" current="storage/richstorage.js"></div>
          </div>
          <!-- Column 2 end -->
        </div>
</div>
</div>

</body>
</html>
